package com.sangeng.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Service;

@Service
@Aspect
public class CryptSAspect {

    @Pointcut("@annotation(com.sangeng.aspect.Crypt)")
    public void pt() {

    }


    @Around("pt()")
    public Object crypt(ProceedingJoinPoint pjp) {
        //获取去目标方法执行后
        Object proceed = null;
        try {
            proceed = pjp.proceed();//目标方法调用
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }

        return proceed;
    }
}
